package com.hk.core.data.jpa.domain;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.hk.commons.util.Constants;
import jakarta.persistence.Column;
import jakarta.persistence.MappedSuperclass;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.FilterDef;
import org.hibernate.annotations.ParamDef;

import java.math.BigInteger;

/**
 * @author kevin
 * @date 2019-7-2 16:59
 */
@Getter
@Setter
@MappedSuperclass
@FilterDef(name = Constants.DATA_FILTER_NAME, parameters = {@ParamDef(name = "dataRule", type = BigInteger.class)})
public abstract class AbstractDataRuleSnowflakeAuditable extends AbstractSnowflakeAuditable
        implements DataRulePersistable<Long> {

    @Column(name = "data_rule", updatable = false)
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private BigInteger dataRule;

    @Override
    public boolean equals(Object obj) {
        return super.equals(obj);
    }

    @Override
    public int hashCode() {
        return super.hashCode();
    }

}
